# -*- coding: utf-8 -*-
"""
Created on Thu Oct  4 22:01:09 2018

@author: cheny
"""

num = input("请输入一个自然数：")
num = int(num)
count = 0
while num != 1 :
    if num % 2 == 1:
        num = 3 * num + 1
        print("第{0}步：{1} * 3 + 1 = {2}".format(count+1,(num-1)/3, num))
    else:
        num = num / 2
        print("第{0}步：{1} / 2 = {2}".format(count+1, num*2 ,num))
    count += 1

print("一共需要经过{0}步才能得到1".format(count))